/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.atp.agencia.frame;

import javax.swing.event.AncestorListener;
import javax.swing.event.InternalFrameEvent;
import javax.swing.event.InternalFrameListener;

/**
 *
 * @author Afonso
 */
public class WindowEventHandler implements InternalFrameListener {

    @Override
    public void internalFrameActivated(InternalFrameEvent e) {
        dumpInfo("Activated", e);
    }

    @Override
    public void internalFrameClosed(InternalFrameEvent e) {
        dumpInfo("Closed", e);
    }

    @Override
    public void internalFrameClosing(InternalFrameEvent e) {
        dumpInfo("Closing", e);
    }

    @Override
    public void internalFrameDeactivated(InternalFrameEvent e) {
        dumpInfo("Deactivated", e);
    }

    @Override
    public void internalFrameDeiconified(InternalFrameEvent e) {
        dumpInfo("Deiconified", e);
    }

    @Override
    public void internalFrameIconified(InternalFrameEvent e) {
        dumpInfo("Iconified", e);
    }

    @Override
    public void internalFrameOpened(InternalFrameEvent e) {
        dumpInfo("Opened", e);
    }

    private void dumpInfo(String s, InternalFrameEvent e) {
        System.out.println("Source: " + e.getInternalFrame().getName()
                + " : " + s );
    }
}
